-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix detection of suitable architecture for conversion when LXD is clustered #14586
Conversation
…hen LXD is clustered Signed-off-by: Din Music <[email protected]>
@@ -547,7 +547,7 @@ func ResolveImage(ctx context.Context, tx *db.ClusterTx, projectName string, sou | |||
// A nil list indicates that we can't tell at this stage, typically for private images. | |||
func SuitableArchitectures(ctx context.Context, s *state.State, tx *db.ClusterTx, projectName string, sourceInst *cluster.Instance, sourceImageRef string, req api.InstancesPost) ([]int, error) { | |||
// Handle cases where the architecture is already provided. | |||
if shared.ValueInSlice(req.Source.Type, []string{"migration", "none"}) && req.Architecture != "" { | |||
if shared.ValueInSlice(req.Source.Type, []string{"conversion", "migration", "none"}) && req.Architecture != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a separate PR please can we have constants created for these values so we can see where they are referenced in the code.
@MusicDin once merged please can you prepare a cherry-pick against lxd-pkg-snap latest-candidate branch to include this commit in 6.2 |
Architecture was populated, but |
why was clustering relevant? |
When target server is not provided the architecture is used to decide upon suitable cluster member to run the new instance. Lines 1227 to 1259 in 6d29cd6
|
Cherry-pick canonical/lxd@dd7b99e (related PR: canonical/lxd#14586)
Thanks to @escabo for reporting the issue where conversion fails if LXD is clustered and supports API extension
instance_import_conversion
.Not sure how this slipped through for such a long time. Seems I have messed something up when juggling with commit order on initial implementation, as I remember configuring this.
Anyway, the issue is detection of suitable architecture, where source type was not matched with any case resulting in an error: